package cn.ludi.controller;


import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
@Api(tags = "测试相关接口")
public class TestController {

    @Autowired
    private RedisTemplate redisTemplate;

    @ApiOperation("测试")
    @GetMapping("/hello")
    public String get(){
        redisTemplate.opsForValue().set("卢迪",1);
        return JSON.toJSONString(1);
    }
}
